var e = require;
var t = module;
var o,
    n,
    i = (t.exports = {});
function a() {
    throw new Error("setTimeout has not been defined");
}
function r() {
    throw new Error("clearTimeout has not been defined");
}
function s(e) {
    if (o === setTimeout) return setTimeout(e, 0);
    if ((o === a || !o) && setTimeout) return (o = setTimeout), setTimeout(e, 0);
    try {
        return o(e, 0);
    } catch (t) {
        try {
            return o.call(null, e, 0);
        } catch (t) {
            return o.call(this, e, 0);
        }
    }
}
function c(e) {
    if (n === clearTimeout) return clearTimeout(e);
    if ((n === r || !n) && clearTimeout) return (n = clearTimeout), clearTimeout(e);
    try {
        return n(e);
    } catch (t) {
        try {
            return n.call(null, e);
        } catch (t) {
            return n.call(this, e);
        }
    }
}
(function () {
    try {
        o = "function" == typeof setTimeout ? setTimeout : a;
    } catch (e) {
        o = a;
    }
    try {
        n = "function" == typeof clearTimeout ? clearTimeout : r;
    } catch (e) {
        n = r;
    }
})();
var l,
    d = [],
    u = !1,
    p = -1;
function h() {
    u && l && ((u = !1), l.length ? (d = l.concat(d)) : (p = -1), d.length && f());
}
function f() {
    if (!u) {
        var e = s(h);
        u = !0;
        for (var t = d.length; t; ) {
            for (l = d, d = []; ++p < t; ) l && l[p].run();
            (p = -1), (t = d.length);
        }
        (l = null), (u = !1), c(e);
    }
}
function _(e, t) {
    (this.fun = e), (this.array = t);
}
function y() {}
(i.nextTick = function (e) {
    var t = new Array(arguments.length - 1);
    if (arguments.length > 1) for (var o = 1; o < arguments.length; o++) t[o - 1] = arguments[o];
    d.push(new _(e, t)), 1 !== d.length || u || s(f);
}),
    (_.prototype.run = function () {
        this.fun.apply(null, this.array);
    }),
    (i.title = "browser"),
    (i.browser = !0),
    (i.env = {}),
    (i.argv = []),
    (i.version = ""),
    (i.versions = {}),
    (i.on = y),
    (i.addListener = y),
    (i.once = y),
    (i.off = y),
    (i.removeListener = y),
    (i.removeAllListeners = y),
    (i.emit = y),
    (i.prependListener = y),
    (i.prependOnceListener = y),
    (i.listeners = function () {
        return [];
    }),
    (i.binding = function () {
        throw new Error("process.binding is not supported");
    }),
    (i.cwd = function () {
        return "/";
    }),
    (i.chdir = function () {
        throw new Error("process.chdir is not supported");
    }),
    (i.umask = function () {
        return 0;
    });
